import com.uestc.ssm.PO.User;
import com.uestc.ssm.dao.UserDaoImpl;
import com.uestc.ssm.dao.UserMapper;
import com.uestc.ssm.dao.UserMapperImpl;
import com.uestc.ssm.service.UserServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringTest {
    @Test
    public void Test1(){
        ApplicationContext context = new ClassPathXmlApplicationContext("ApplicationMapper.xml");
        UserMapper userMapper = context.getBean("UserMapperImpl",UserMapper.class);
        User user = userMapper.getUserById(1);
        System.out.println(user.toString());
        user.setId(5);
        user.setName("张博宇");
        userMapper.updateUser(user);
        System.out.println(user.toString());
    }
}
